/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.cash.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;
import com.chlitina.store.modules.base.entity.Customer;
import com.chlitina.store.modules.employee.entity.Employee;
import com.chlitina.store.modules.sys.entity.Store;

/**
 * 预约登记Entity
 * 
 * @author lvbo
 * @version 2013-11-05
 */
@Entity
@Table(name = "store_reserve")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StoreReserve extends BaseEntity {

	public static final int SMS_NOTIFIED = 1;
	public static final int SMS_NOT_NOTIFIED = 0;
	private static final long serialVersionUID = 1L;
	private Long id; // 编号
	private Store store; // 店面
	private Employee employee; // 美容师
	private Customer member; // 客户-会员
	private String customerName; // 姓名-散客
	private String customerMobile; // 电话-散客
	private Date requestTime; // 预约时间
	private Date reserveTime; // 来店时间
	private String reason; // 预约内容
	private int smsNotified; // 是否已短信通知客户？0：未通知 1：已通知

	public StoreReserve() {
	}

	public StoreReserve(Long id) {
		this();
		this.id = id;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	// @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
	// "seq_cash_storeReserve")
	// @SequenceGenerator(name = "seq_cash_storeReserve", sequenceName =
	// "seq_cash_storeReserve")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="store_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="employee_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="customer_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public Customer getMember() {
		return member;
	}

	public void setMember(Customer member) {
		this.member = member;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getCustomerMobile() {
		return customerMobile;
	}

	public void setCustomerMobile(String customerMobile) {
		this.customerMobile = customerMobile;
	}

	@Column(name="request_time")
	public Date getRequestTime() {
		return requestTime;
	}

	public void setRequestTime(Date requestTime) {
		this.requestTime = requestTime;
	}

	@Column(name="reserve_time")
	public Date getReserveTime() {
		return reserveTime;
	}

	public void setReserveTime(Date reserveTime) {
		this.reserveTime = reserveTime;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	@Column(name="sms_notified")
	public int getSmsNotified() {
		return smsNotified;
	}

	public void setSmsNotified(int smsNotified) {
		this.smsNotified = smsNotified;
	}

}
